#ifndef FMOD_SOUND_H
#define FMOD_SOUND_H

#include "WindowsCompatibility/Physx.h"

#include <windows.h>
#include <fmod.hpp>
#include <string>

class Sound {
public:
	enum SAMPLE {
		SAMPLE_STONE1,
		SAMPLE_STONE2,
		SAMPLE_STONE3,
		SAMPLE_KNOCK,
		SAMPLE_SCROLL,
		SAMPLE_EXPLOSION,
		SAMPLE_SHOOT,
		SAMPLE_CLEAR,

		SAMPLES_COUNT
	};

protected:
	static FMOD::System *system;
	static FMOD::Sound *sound[SAMPLES_COUNT];
	static FMOD::Channel *channel;

	static const std::string folder;
	static const std::string extension;
	static std::string path[SAMPLES_COUNT];

	static const FMOD_VECTOR fmodUpVector;
	static const FMOD_VECTOR fmodNullVector;

	static float cooldown;

public:
	static void Init();
	static void Play(SAMPLE sample, float volume, const NxVec3& sourcePosition, const NxVec3& listenerForward);
	static void Play(SAMPLE sample, float volume);
	static void Tick(float elapsedTime);

protected:
	static void ErrorCheck(FMOD_RESULT result);
};

#endif //FMOD_SOUND_H
